import { Component, OnInit, Output, EventEmitter, Input } from "@angular/core";

export interface SelectData {
    id: string;
    value: string;
}

@Component({
    selector: 'select-component',
    templateUrl: './select.component.html'
})
export class SelectComponent implements OnInit {
    option: string;

    @Input() select: string;

    @Input() options: Array<SelectData>;

    @Output() selectionChanged = new EventEmitter<any>();

    constructor() {
        // TODO 
    }

    ngOnInit(): void {
        this.option = this.select;
    }

    changeSelect(event) {
        this.selectionChanged.emit(event);
    }
}
